package com.zscat.mallplus.service.cms.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.zscat.mallplus.pms.entity.CmsSubjectProductRelation;
import com.zscat.mallplus.pms.mapper.CmsSubjectProductRelationMapper;
import com.zscat.mallplus.pms.vo.HomeProductInfo;
import com.zscat.mallplus.service.cms.service.ICmsSubjectProductRelationService;
import com.zscat.mallplus.vo.PageInfo;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 * 专题商品关系表 服务实现类
 * </p>
 *
 * @author zscat
 * @since 2019-04-17
 */
@Service
public class CmsSubjectProductRelationServiceImpl extends ServiceImpl<CmsSubjectProductRelationMapper, CmsSubjectProductRelation> implements ICmsSubjectProductRelationService {

    @Override
    public PageInfo<HomeProductInfo> getSubjectProductList(Integer subjectId, Integer pageIndex, Integer pageSize) {
        int start = (pageIndex - 1) * pageSize;
        int len = pageSize;
        List<HomeProductInfo> list = this.baseMapper.getSubjectProductList(subjectId, start, len);
        return new PageInfo<>(pageIndex, pageSize, list);
    }

}
